package org.xtext.example.generator

import org.eclipse.xtext.xbase.compiler.JvmModelGenerator
import org.eclipse.xtext.generator.IGenerator
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.xtext.generator.IFileSystemAccess
import com.google.inject.Inject

public class AgentGenerator extends JvmModelGenerator implements IGenerator {

	@Inject GenUtils util

	override doGenerate(Resource resource, IFileSystemAccess fsa) {
		println("AgentGenerator starts resouce=" + resource)
		println("AgentGenerator start fsa=" + fsa)
		util.setFsa(fsa)
		util.setResource(resource)
		
		new AgentMyGen().doGenerate(util, this)
	}
	
	def genJava() {
		super.doGenerate(util.resource, util.fsa)
	}
	
}
